﻿
@{
    ViewBag.Title = "Personal";
}

@model IEnumerable<Message_Board.Models.Message>
<h2>@ViewBag.userName</h2>
<fieldset style="margin-top: 30px;">
    <legend>自己创建的主题</legend>
    <br />
    <table  width="100%">
        <tr>
            <th> 留言主题 </th>
            <th> 留言类型 </th>
            <th> 留言内容 </th>
            <th> 留言时间 </th>
            <th> 操作 </th>
            <th> <a href="/Messages/Create">创建一个新的主题</a> </th>
        </tr>
        @for (int i = 0; i < 3; i++)
        {
            if (Model.Where(s => s.Number == 1).Count() == 0)
            { break; }
            if (Model.Where(s => s.Number == 1).Skip(i).Count() == 0)
            { break; }
            <tr>
                <td> <label><a href="/Messages/Details?subject=@Model.Where(s => s.Number == 1).Skip(i).First().Subject">@Model.Where(s => s.Number == 1).Skip(i).First().Subject</a>  </label> </td>
                <td> <label>@Model.Where(s => s.Number == 1).Skip(i).First().MessageType </label> </td>
                <td> <label>@Model.Where(s => s.Number == 1).Skip(i).First().Content </label> </td>
                <td> <label>@Model.Where(s => s.Number == 1).Skip(i).First().Time</label> </td>
                <td> <label><a href="/Messages/DeleteSubject?subject=@Model.Where(s => s.Number == 1).Skip(i).First().Subject">删除</a></label> </td>
            </tr>
        }
        <tr><td><label><a href="/Messages/PersonalSubject">更多......</a></label></td></tr>
    </table>
</fieldset>
<fieldset  style="margin-top: 30px;">
    <legend>自己的回复</legend>
    <table width="100%">
        <tr>
            <th> 留言内容 </th>
            <th> 留言主题 </th>
            <th> 留言类型 </th>
            <th> 留言时间 </th>
            <th> 留言楼数 </th>
            <th> 回复：</th>
            <th> 操作</th>
        </tr>
        @for (int i = 0; i < 3; i++)
        {
            if (@Model.Where(s => s.Number > 1).Count() == 0)
            { break; }
            if (@Model.Where(s => s.Number > 1).Skip(i).Count() == 0)
            { break; }
            <tr>
                <td> <label><a href="/Messages/Details2?id=@Model.Where(s => s.Number > 1).Skip(i).First().ID">@Model.Where(s => s.Number > 1).Skip(i).First().Content </a></label> </td>
                <td> <label>@Model.Where(s => s.Number > 1).Skip(i).First().Subject</label> </td>
                <td> <label>@Model.Where(s => s.Number > 1).Skip(i).First().MessageType </label> </td>
                <td> <label>@Model.Where(s => s.Number > 1).Skip(i).First().Time </label> </td>
                <td> <label>@Model.Where(s => s.Number > 1).Skip(i).First().Number</label> </td>
                <td> <label>@Model.Where(s => s.Number > 1).Skip(i).First().ReplyNumber 楼 (@Model.Where(s => s.Number > 1).Skip(i).First().ReplyName)</label> </td>
                <td> <label><a href="/Messages/DeleteReply?id=@Model.Where(s => s.Number > 1).Skip(i).First().ID">删除</a></label> </td>
            </tr>
        }
        <tr><td><label><a href="/Messages/PersonalReply">更多......</a></label></td></tr>
    </table>
</fieldset>


